home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Apple Location Manager / Sources / Sample.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-19  |  4.1 KB  |  189 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Sample.h
  3.  
  4.      Contains:    Location Manager SDK Sample Module Rez/C includes
  5.  
  6.      Version:    ALM SDK 1.0
  7.                  Package:    Location Manager SDK 1.0
  8.  
  9.      Copyright:    © 1984-1997 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@apple.com
  16.  
  17. */
  18.  
  19. #ifndef        __SAMPLE__
  20. #define        __SAMPLE__
  21.  
  22. // --------------------------------------------------------------------------------------
  23.  
  24. #ifdef    REZ
  25.  
  26. #ifndef        __SYSTYPES_R__
  27. #include    "SysTypes.r"
  28. #endif        // __SYSTYPES_R__
  29.  
  30. #ifndef        __TYPES_R__
  31. #include    "Types.r"
  32. #endif        // __TYPES_R__
  33.  
  34. #else
  35.  
  36. #ifndef        __TYPES__
  37. #include    <Types.h>
  38. #endif        // __TYPES__
  39.  
  40. #endif    // REZ
  41.  
  42. // --------------------------------------------------------------------------------------
  43.  
  44. // Errors...
  45.  
  46. #define        kSampleErrStrRsrcID            10000
  47. #define            kSampleImportPrefDatesIdx    1
  48. #define            kSampleCouldNotQuitIdx        2
  49. #define            kSampleBiggestKnownIdx        kSampleCouldNotQuitIdx
  50.  
  51. // Other text...
  52.  
  53. #define        kSampleMiscStrRsrcID        10001
  54. #define            kSampleDescribeTemplateIdx    1
  55.  
  56. // Constants for common use...
  57.  
  58. #define        kAppListNeverQuit            0x00
  59. #define        kAppListQuitOnSet            0x80
  60. #define        kAppListQuitOnGet            0x40
  61. #define        kAppListQuitOnGetOrSet        0xC0
  62.  
  63. #define        kNoRestart                    0x00
  64. #define        kRestartIfChanged            0x80
  65.  
  66. #define        kExecutableRsrcType            'code'
  67. #define        kExecutableRsrcID            10000
  68.  
  69. #define        kNameRsrcType                'STR '
  70. #define        kNameRsrcID                    10000
  71.  
  72. #define        kDescRsrcType                'STR '
  73. #define        kDescRsrcID                    10001
  74.  
  75. #define        kIconRsrcType                'ICON'
  76. #define        kIconRsrcID                    10000
  77.  
  78. #define        kINTLrsrcType                'intl'
  79. #define        kINTLrsrcTypeString            "intl"
  80. #define        kINTLrsrcID                    10000
  81.  
  82. #define        kAppsRsrcType                'apps'
  83. #define        kAppsRsrcTypeString            "apps"
  84. #define        kAppsRsrcID                    10000
  85.  
  86. #define        kFilesRsrcType                'fils'
  87. #define        kFilesRsrcTypeString        "fils"
  88. #define        kFilesRsrcStartID            10000
  89.  
  90. #define        kRestartRsrcType            'rstr'
  91. #define        kRestartRsrcTypeString        "rstr"
  92. #define        kRestartRsrcStartID            10000
  93.  
  94. #define        kGetInfoRsrcID                10000
  95.  
  96. // --------------------------------------------------------------------------------------
  97.  
  98. // A bunch of structures we keep in resources; do the rez versions first, then the C
  99. // versions...
  100.  
  101. #ifdef    REZ
  102.  
  103. // Internationalization in an easy place for internationalizers to get at it...
  104.  
  105. type kINTLrsrcType {
  106.     integer    kALMScriptInfoVersion = 2;
  107.     integer        Script;
  108.     integer     Region;
  109.     integer     Language;
  110.     integer;    //    fontSize
  111.     pstring;    //    fontName;
  112. };
  113.  
  114. type 'TMPL' {
  115.     wide array Fields {
  116.         pstring;        // field name
  117.         string[4];        // field type
  118.     };
  119. };
  120.  
  121. type kAppsRsrcType {
  122.     integer = $$CountOf (AppArray);
  123.     array AppArray {
  124.         string[4];                // Application to quit
  125.         unsigned hex byte
  126.             neverQuit        = kAppListNeverQuit,
  127.             quitOnSet        = kAppListQuitOnSet,
  128.             quitOnGet        = kAppListQuitOnGet,
  129.             quitOnGetOrSet    = kAppListQuitOnGetOrSet;
  130.         align word;
  131.     };
  132. };
  133.  
  134. type kFilesRsrcType as 'STR ';
  135.  
  136. type kRestartRsrcType {
  137.     unsigned hex byte
  138.         dontRestart            = kNoRestart,
  139.         doRestart            = kRestartIfChanged;
  140.     align word;
  141. };
  142.  
  143. #else
  144.  
  145. #if        PRAGMA_ALIGN_SUPPORTED
  146. #pragma options align=mac68k
  147. #endif    // PRAGMA_ALIGN_SUPPORTED
  148.  
  149. typedef struct {
  150.     SInt16             version;
  151.     SInt16             scriptCode;
  152.     SInt16             regionCode;
  153.     SInt16             langCode;
  154.     SInt16             fontSize;
  155.     Str63            fontName;
  156. } INTLinfoRec, *INTLinfoPtr, **INTLinfoHandle;
  157.  
  158. // (Do not require an analog for 'TMPL')
  159.  
  160. typedef struct {
  161.     OSType            applicationCode;
  162.     UInt8            flags;
  163.     UInt8            filler1;
  164. } ApplicationEntry;
  165.  
  166. typedef struct {
  167.     SInt16                applicationCount;
  168.     ApplicationEntry    applications[kVariableLengthArray];
  169. } ApplicationListRec, *ApplicationListPtr, **ApplicationListHandle;
  170.  
  171. typedef struct {
  172.     Str255            fileName;
  173. } FileEntryRec, *FileEntryPtr, **FileEntryHandle;
  174.  
  175. typedef struct {
  176.     UInt8            flags;
  177.     UInt8            filler1;
  178. } FileFlagsRec, *FileFlagsPtr, **FileFlagsHandle;
  179.  
  180. #if        PRAGMA_ALIGN_SUPPORTED
  181. #pragma options align=reset
  182. #endif    // PRAGMA_ALIGN_SUPPORTED
  183.  
  184. #endif    // REZ
  185.  
  186. // --------------------------------------------------------------------------------------
  187.  
  188. #endif        // __SAMPLE__
  189.